package com.mnsq.category.controller;

import com.mnsq.category.service.TypeService;
import com.mnsq.common.bean.entity.category.Type;
import com.mnsq.common.bean.vo.category.TypeCondition;
import com.mnsq.common.controller.BaseController;
import com.mnsq.common.service.BaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import matrix.module.common.bean.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * @date 2019/3/10 0010
 */
@Api("主类型接口")
@RestController
@RequestMapping("/api/type")
public class TypeController extends BaseController<Type, BaseService<Type, TypeCondition>, TypeCondition> {

    @Autowired
    private TypeService typeService;

    @ApiOperation("列表接口")
    @RequestMapping(value = "list", method = RequestMethod.GET)
    public Result listType(TypeCondition typeCondition) {
        return Result.success(typeService.queryList(typeCondition));
    }
}
